package com.dfqy.pojo;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.io.Serializable;
import java.util.Date;

/**
 * Author : atyushu
 * Package : com.dfqy.pojo
 * ClassName : User
 * Create : 2023/7/31 - 11:52
 * Version : v1.0
 * Description : The class of pojo for user.
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("注册用户")
public class User implements Serializable {

    private long id;

    @NotBlank(message = "姓名不能为空")
    @ApiModelProperty("姓名，最大长度50，not null")
    private String uname;

    @ApiModelProperty("手机号，最大长度40")
    private String phone;

    @ApiModelProperty("密码，最大长度200")
    private String pass;

    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm")
    @JsonFormat(locale = "zh", pattern = "yyyy-MM-dd HH:mm", timezone = "GMT+8")
    @ApiModelProperty("注册用户")
    private Date regtime;

    @ApiModelProperty("是否合法，最大长度1，值为0或1，0为不合法，1为合法")
    private byte isvalid;

    @ApiModelProperty("头像，最大长度200，内容为图像上传后的地址")
    private String avator;

    @ApiModelProperty("积分")
    private int score;

    @ApiModelProperty("余额")
    private int balance;

    @ApiModelProperty("个人标签，最大长度200")
    private String personlabel;

    @ApiModelProperty("QQ号，最大长度30")
    private String qq;

    @ApiModelProperty("微博，最大长度50")
    private String weibo;

    public User(String uname, String phone, String pass, Date regtime, byte isvalid, String avator, int score, int balance, String personlabel, String qq, String weibo) {
        this.uname = uname;
        this.phone = phone;
        this.pass = pass;
        this.regtime = regtime;
        this.isvalid = isvalid;
        this.avator = avator;
        this.score = score;
        this.balance = balance;
        this.personlabel = personlabel;
        this.qq = qq;
        this.weibo = weibo;
    }
}
